<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/30/0030
 * Time: 13:57
 */

namespace app\sports_admin\model;


use think\Model;
use traits\model\SoftDelete;

class PaySet extends Model
{
    use SoftDelete;
    protected $table = 'pay_set';

    protected $pk = 'id';

    protected $autoWriteTimestamp = true;

    //查询微信支付配置信息
    public static function WxPaySet()
    {
        return self::where('type',1)->find();
    }
    //查询阿里支付配置信息
    public static function AliPaySet()
    {
        return self::where('type',2)->find();
    }

    /**
     * 支付说明
     */
    public static function getList($page,$rows)
    {
        $rows = self::order('id','desc')->limit($rows)->page($page)->field('id,title')->select();
        $total = self::count();
        return ['rows'=>$rows,'total'=>$total];
    }
}